<?php
session_start(); 
if(!isset($_SESSION['userName'])){
header( 'location:../../index.php' ); 
}
	include("../../conf/connect.php");
	$user_id = $_SESSION['user_id'];
	$hhid= $_GET['hhid'];
	$bid= $_GET['bid'];
	
	if ($bid==3){
		$_SESSION['usrHHid']=$hhid;
		header( 'location: ../rel_detail.php' );
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="../../style.css" media="screen" />
	<link rel="shortcut icon" href="../images/favicon.ico" />
</head>
<body class="iub_back">
	<form method="post" action="update_operation.php?qus=upd1">
	<table align="center" class="table_border">
			<tr>
					<td class="header"><b class="htext">IUB Survey :: </b><br /><hr /> </td>
			</tr>
			<tr>
					<td> Field : </td>
			</tr>
			<tr>
					<td><input type="hidden" name="bid" value="<?php echo $bid;?> " />
						<select name="qusNo">						
								<option value="#">Sorroundings</option>
								<option value="q10">Human/Animal Waste</option>
								<option value="q11">Natural Waste</option>
								<option value="q12">Cowshed Nearby</option>
								<option value="q13">Household Clean</option>
								<option value="q19">House Status</option>
								<option value="q20">House Fare</option>
								<option value="q14">MBed room floor type</option>
								<option value="q15">MBed room wall type</option>
								<option value="q16"> MBed room roof type</option>
								<option value="q17">House Electrified</option>
								<option value="q18">Any electrified house</option>
								<option value="q22">Drink water source</option>
								<option value="q23">Place</option>
								<option value="q24">Time to reach</option>
								<option value="q25">Wash water source</option>
								<option value="q26">Place</option>
								<option value="q27">Time to reach</option>
								<option value="q28">Main Fuel</option>
								<option value="q29">Cooking Area</option>
								<option value="q30">Is it in kitchen</option>
								<option value="q31">Outside Cooking</option>
								<option value="q32">Type of Latrine</option>
								<option value="q33">Sandal Used</option>
								<option value="q34">Frequency washing hand</option>
								<option value="q35">Soap Used</option>
								<option value="q36">Wash before Meal</option>
								<option value="q37">Soap Used</option>
								<option value="q38">When Used</option>
								<option value="q39">Water Pure Method</option>
								<option value="q40">Suffering on food</option>
								<option value="q41">Suffering on cloth</option>	
								<option value="q42">Suffering on bill pay</option>
								<option value="q43">Monthly Income</option>
								<option value="q44">Monthly Cost</option>
								<option value="q45">Cultivatable Land</option>
								<option value="q46">Measure</option>									
						</select>
					</td>
			</tr>
			<tr>
					<td align="right" valign="bottom"><input type="submit" value="Update" class="input-box" /> &nbsp;&nbsp;<a href="../index2.php" class="input-box"> Home &nbsp;&nbsp; </a></td>
			</tr>
			<tr>
					<td> <i>Answer(s)</i> : <input type="hidden" name="hhhid" value="<?php echo $hhid;?>" /></td>
			</tr>
			 		
			<?php
				$sql ="SELECT * FROM household_info where hid='$hhid'";
				$result=mysql_query( $sql);
				while($row = mysql_fetch_array($result)){
				?>	
			<tr>
					<td>Human/Animal Waste&nbsp;:&nbsp; <?php 
						$data=$row['hc01_1'];
						
						$hello="SELECT * FROM retreive_data where qus='hc01_01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						} 
					?> </td>
			</tr>
			<tr>
					<td>Natural Waste&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc01_2'];
						
						$hello="SELECT * FROM retreive_data where qus='hc01_02' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Cowshed Nearby&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc01_3'];
						
						$hello="SELECT * FROM retreive_data where qus='hc01_03' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Household Clean&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc01_4'];
						
						$hello="SELECT * FROM retreive_data where qus='hc01_04' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>House Status&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc02'];
						
						$hello="SELECT * FROM retreive_data where qus='hc02' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>House Fare&nbsp;:&nbsp; <?php echo $row['hc03'];?></td>
			</tr>
			<tr>
					<td>MBed room floor type&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc05'];
						$hello="SELECT * FROM retreive_data where qus='hc05' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						
					?> </td>
			</tr>
			<tr>
					<td>MBed room wall type&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc06'];
						
						$hello="SELECT * FROM retreive_data where qus='hc06' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>MBed room roof type&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc07'];
						
						$hello="SELECT * FROM retreive_data where qus='hc07' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>House Electrified&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc08'];
						
						$hello="SELECT * FROM retreive_data where qus='hc08' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>Any electrified house&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc09'];
						
						$hello="SELECT * FROM retreive_data where qus='hc09' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Main Drink water source&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc10'];
						
						$hello="SELECT * FROM retreive_data where qus='hc10' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>Place&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc11'];
						
						$hello="SELECT * FROM retreive_data where qus='hc11' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>Time to reach&nbsp;:&nbsp; <?php echo $row['hc12'];?>&nbsp;min</td>
			</tr>
			<tr>
					<td>Washing water source&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc13'];
						
						$hello="SELECT * FROM retreive_data where qus='hc13' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Place&nbsp;:&nbsp; <?php 
						$data=$row['hc14'];
						
						$hello="SELECT * FROM retreive_data where qus='hc14' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Time to reach&nbsp;:&nbsp; <?php echo $row['hc15'];?>&nbsp;min</td>
			</tr>
			<tr>
					<td>Main Fuel&nbsp;:&nbsp; 
					<?php 
						$data=$row['h16'];
						
						$hello="SELECT * FROM retreive_data where qus='h16' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Cooking Area&nbsp;:&nbsp; 
					<?php 
						$data=$row['h17'];
						
						$hello="SELECT * FROM retreive_data where qus='h17' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Kithen has&nbsp;:&nbsp; 
					<?php 
						$data=$row['h18'];
						
						$hello="SELECT * FROM retreive_data where qus='h18' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Cooking Period&nbsp;:&nbsp; <?php echo $row['h19'];?></td>
			</tr>
			<tr>
					<td>Type of Latrine&nbsp;:&nbsp; 
					<?php 
						$data=$row['h20_01'];
						
						$hello="SELECT * FROM retreive_data where qus='h20_01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Sandal Used&nbsp;:&nbsp; 
					<?php 
						$data=$row['h21_01'];
						
						$hello="SELECT * FROM retreive_data where qus='h21_01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>Frequency of washing hand&nbsp;:&nbsp; 
					<?php 
						$data=$row['h22_01'];
						
						$hello="SELECT * FROM retreive_data where qus='h22_01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>Soap Used&nbsp;:&nbsp; 
					<?php 
						$data=$row['h23_01'];
						
						$hello="SELECT * FROM retreive_data where qus='h23_01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Wash Before Meal&nbsp;:&nbsp; 
					<?php 
						$data=$row['h24'];
						
						$hello="SELECT * FROM retreive_data where qus='h24' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Soap Used&nbsp;:&nbsp; 
					<?php 
						$data=$row['h25'];
						
						$hello="SELECT * FROM retreive_data where qus='h25' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>When Used&nbsp;:&nbsp; 
					<?php 
						$data=$row['h26'];
						
						$hello="SELECT * FROM retreive_data where qus='h26' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Water Pure Method&nbsp;:&nbsp; 
					<?php 
						$data=$row['h27'];
						
						$hello="SELECT * FROM retreive_data where qus='h27' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Suffering on food&nbsp;:&nbsp; <?php echo $row['h28_a_1'];?></td>
			</tr>
			<tr>
					<td>Suffering on cloth&nbsp;:&nbsp; <?php echo $row['h28_b_1'];?></td>
			</tr>
			<tr>
					<td>Suffering on bill pay&nbsp;:&nbsp; <?php echo $row['h28_c_1'];?></td>
			</tr>
			<tr>
					<td>Monthly Income&nbsp;:&nbsp; <?php echo $row['h29'];?></td>
			</tr>
			<tr>
					<td>Monthly Cost&nbsp;:&nbsp; <?php echo $row['h30'];?></td>
			</tr>
			<tr>
					<td>Cultivatable Land&nbsp;:&nbsp; <?php echo $row['h31'];?></td>
			</tr>
			<tr>
					<td>Measure&nbsp;:&nbsp; <?php echo $row['h32'];?></td>
			</tr>
			<?php 		
								
				}			
			?>
						
		</table>
		</form>
</body>
</html>